package com.gaoshu.controller;

import com.gaoshu.bean.Skull;
import com.gaoshu.service.SkullService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("/skullController")
public class SkullController {
    @Autowired
    private SkullService skullService;


    //动态查询经办人信息
    @RequestMapping("/selectSkull.do")
    public String selectSkull(String skullname, Model model){
        List<Skull> list=skullService.selectSkull(skullname);
        model.addAttribute("list",list);
        return "";
    }


    //新增经办人
    @RequestMapping("/addSkull.do")
    public String addSkull(Skull skull){
        int i=skullService.addSkull(skull);
        return "";
    }

    //删除经办人
    @RequestMapping("/deleteSkull.do")
    public String deleteSkull(Integer skullid){
        int i=skullService.deleteSkull(skullid);
        return "";
    }

    //修改经办人信息
    @RequestMapping("/updateSkull.do")
    public String updateSkull(Skull skull){
        int i=skullService.updateSkull(skull);
        return "";
    }
}
